﻿using System;
class SequenceSum
{
    static void Main()
    {
        Console.WriteLine("x=");
        double x = int.Parse(Console.ReadLine());
        Console.WriteLine("n=");
        double n = int.Parse(Console.ReadLine());
        double sum = 0;
        double factorial = 1;

        for (double i = 1; i <= n; i++)
        {
            factorial *= i;
            sum += factorial / (Math.Pow(x, i));
        }
        Console.WriteLine("1 + 1!/X + 2!/X^2 +...+ N!/X^N = {0} ", sum + 1);
    }
}
